package com.hospital.diagnosis.module.controller;

import com.hospital.common.base.Result;
import com.hospital.common.vo.diagnosis.module.AiDiagnosisRecordVo;
import com.hospital.diagnosis.module.service.TAiDiagnosisRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ai诊疗相关接口
 * @author yhn
 * @version 1.0
 */
@RestController
@RequestMapping("/aiDiagnosis")
public class AiDiagnosisController {
    @Autowired
    private TAiDiagnosisRecordService aiDiagnosisRecordService;

    /**
     * 根据患者id查询患者所有ai诊疗记录
     * @param patientId 患者id
     */
    @GetMapping("/queryByPatientId")
    public Result<List<AiDiagnosisRecordVo>> queryByPatientId(@RequestParam("patientId") Long patientId) {
        return Result.success(aiDiagnosisRecordService.queryByPatientId(patientId));
    }

    /**
     * 医生采纳ai诊断建议
     * @param patientId  患者id
     * @param diagnosisId 诊断id
     */
    @GetMapping("/accept")
    public Result<?> accept(@RequestParam("patientId") Long patientId,@RequestParam("diagnosisId") Long diagnosisId) {
        aiDiagnosisRecordService.accept( patientId, diagnosisId);
        return Result.success();
    }
}
